package com.yyb.utils.neteaseim.api.impl;

import com.jiuqian.xdpx.aid.neteaseim.api.NeImMessageService;
import com.jiuqian.xdpx.aid.neteaseim.bean.entity.NeImMessage;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@Service
public class NeImMessageServiceImpl extends NeImBaseServiceImpl implements NeImMessageService {

    @Override
    public String sendMsg(NeImMessage msg) {
        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
        params.add("form", msg.getFrom());
        params.add("ope", Integer.toString(msg.getOpe()));
        params.add("to", msg.getTo());
        params.add("type", Integer.toString(msg.getType()));
        params.add("body", msg.getBody());
        String code = super.build(params, SEND_MSG, String.class);
        return code;
    }
}
